"""
模拟鼠标操作单击
"""

import time

from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

driver=webdriver.Chrome()
driver.maximize_window()
driver.get("https://www.baidu.com")
driver.find_element(By.ID,"kw").send_keys("selenium")
actions=ActionChains(driver) #实例化键盘操作
element=driver.find_element(By.ID,"su")#定位到百度一下搜索按钮
actions.click(element).perform() #用键盘操作代替点击element
time.sleep(3)
driver.close()